package cn.dly.login.service.impl;

import cn.dly.login.entity.Auth;
import cn.dly.login.mapper.AuthMapper;
import cn.dly.login.mapper.UserMapper;
import cn.dly.login.service.AuthService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Hrd
 * @since 2021-07-05
 */
@Service
public class AuthServiceImpl extends ServiceImpl<AuthMapper, Auth> implements AuthService {

    @Resource
    AuthMapper authMapper;

    @Override
    public List<String> selectAuthValueByUserId(String username) {
        List<Auth> selecAuthValueList=authMapper.findAuth(username);
        List<String> back=new ArrayList<String>();
        for(int i=0;i<selecAuthValueList.size();i++){
            back.add(selecAuthValueList.get(i).getAuthName());
        }
        return back;
    }
}
